package com.lipaluma.field.adaptor;

import java.util.Stack;


/**
 * Class that stack severals Adaptors to be launched for one field.
 * <p>
 * This Class is an Adaptor too. the method adapt will loop on all stacked adaptors.
 * 
 * @author Mario
 *
 */
public class ChainAdaptor extends Stack<Adaptor> {
	private static final long serialVersionUID = -2797426386051614405L;

	public String adapt(String value) {
		if(this.isEmpty())
			return value;
		for (Adaptor adaptor : this) {
			value = adaptor.adapt(value);
		}
		return value;
	}
}
